package com.rainbow.distributed.idempotent.autoconfig;

import org.redisson.api.RedissonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.rainbow.idempotent.lock.DistributedLock;
import com.rainbow.idempotent.lock.RedissonDistributedLock;

/**
 * 分布式锁自动配置
 *
 */
@Configuration
public class DistributedLockAutoConfiguration {

    @Bean
    public DistributedLock distributedLockRedis(RedissonClient redissonClient) {
        return new RedissonDistributedLock(redissonClient);
    }


}